﻿{% extends "base.html" %}
{%block document_ready_js%}
	$("#set_wall_view").click(function(event){
		Set_Cookie("view_mode","wall")
		}
	)
{%endblock%}
{%block sub_nav%}
	当前为列表视图，<a id='set_wall_view' href="">转到图墙视图</a>
	&nbsp;|&nbsp;
	{%if paginator%}
		{{paginator.html}}
	{%endif%}
{%endblock%}

{%block foot_nav%}
	当前为列表视图，<a id='set_wall_view' href="">转到图墙视图</a>
	&nbsp;|&nbsp;
	{%if paginator%}
		{{paginator.html}}
	{%endif%}
{%endblock%}

{% block content %}


        {% if entries %}
          {% for entry in entries %}
            <div class="yui-g rounded">
              <div class="yui-u first">
      	        {%if entry.image%}
      	        <div class="image_holder">
      	        <a href="/entry/{{ entry.key.id }}" title="">
                  <img class="image"  src="/image/{{ entry.image.key.id }}?w=550&h=600"/>
                </a>
                </div>
                {%endif%}
      	      </div>
              <div class="yui-u">
      	        <div class="entry">
      	            <p>
      	        	<a href="{{entry.image.url}}">{{entry.image.width}}x{{entry.image.height}} </a>
				id: {{entry.key.id}} &nbsp;|&nbsp;
				by {% firstof entry.author.nickname "匿名人士"%} at
                  {{ entry.date|timezone:8|date:"Y-m-d H:i:s" }} &nbsp;|&nbsp;<a href="/entry/{{ entry.key.id }}">查看</a>
                    {%if entry.image_purl%}
      	        		&nbsp;|&nbsp;<a href="{{entry.image_purl}}">查看原页面</a>
      	        	{%else%}
      	        		&nbsp;|&nbsp;查看原页面
      	        	{%endif%}
                  {% if admin %}|&nbsp;<a href="/entry/del/{{ entry.key.id }}" onclick="return confirm('确定要删除吗?')">Delete</a>| <a href="/entry/edit/{{ entry.key.id }}">Edit</a>{% endif %}
                {%if entry.comment%}
                <div class="comment">{{ entry.comment|escape|linebreaks }}</div>
                {%endif%}
                </p>
                </div>
                <div class="replies">
                    <div class="new_reply">                    {% if user %}
                        <a href="" onclick="$('#new_reply_form_{{entry.key.id}}').toggle(); return false;">>>我来说两句</a>
                    {% else %}
                        <a href="/login/">>>我来说两句</a>
                    {% endif %}
                        <div id="new_reply_form_{{entry.key.id}}" style="display: none;">
                          <form id="reply_form" action="/reply/new/?entry_id={{entry.key.id}}&redirect_to=/" enctype="multipart/form-data" method="post">
                            <div><textarea name="comment" rows="5"style="width: 100%;" id="id_comment"></textarea></div>
                            <div><input type="submit" value="Submit" /></div>
                          </form>
                        </div>
                    </div>
                    {% if entry.replies %}
                      {% for reply in entry.replies %}
                            <div class="reply"><b>{{reply.author.nickname}}</b> 在{{reply.date|zh_timesince}}之前说:{{ reply.comment|escape|linebreaks }}</div>
                      {% endfor %}
                    {% endif %}
                    
                </div>
      	      </div>
            </div>
          {% endfor %}
 
        {% endif %}

{% endblock %}
